<!DOCTYPE html >
<html>
<head>
<meta name="Generator" content="TPshop v1.1" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>查看详情</title>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<link rel="stylesheet" type="text/css" href="__ROOT__ /AI_radar/js/time/DateTimePicker.css" />
<script type="text/javascript" src="__ROOT__ /AI_radar/js/token.js"></script>
<script src='__ROOT__ /AI_radar/js/jquery.js'></script>
<script type="text/javascript" src="__ROOT__ /AI_radar/js/time/DateTimePicker.js"></script>
<style type="text/css">
	body,html{
		width: 100%;
		height: 100%;
		margin: 0;
		padding: 0;
		overflow-x: hidden;
	}
	p{
		margin:0;
	}
	.top{
		width: 100%;
		padding: 5px 10px;
		display: flex;
		border-bottom: 1px solid #eaeaea;
	}
	.topL{
		width: calc(100% - 50px);
		line-height: 40px;
		overflow: hidden;
	    text-overflow:ellipsis;
	    white-space: nowrap;
	}
	.topR{
		margin-top: 5px;
		width: 30px;
		height: 30px;
		display: inline-block;
	}
	.topR img{
		width: 100%;
		height: 100%;
	}
	.center{
		width: 100%;
		background: #eee;
	}
	.one{
		width: calc(100% - 20px);
		padding: 15px 10px;
		/*display: flex;*/
		border-bottom: 1px solid #eaeaea;
	}
	.seecolor{
		color:#1963AA;
	}
	.seenum{
		color:#1963AA;
	}
	.seedong{
		color:#fb6e00;
	}
	.centerZ{
		width: 100%;
		line-height: 35px;
		text-align: center;
		color: #666666;
		margin:10px 0;
		font-size: 13px;
	}
	
	/*时间选择弹框*/
	.xuan{
		width: 100%;
		height: 100%;
		background: rgba(0,0,0,0.5);
		position: fixed;
		top: 0;
		margin: 0;
		display: none;
	}
	.xuanN{
		width: 90%;
		height: 180px;
		margin-top: calc(50% - 0px);
		margin-left: 5%;
		background: #fff;
		border:1px solid #ccc;
	}
	.xuanT{
		line-height: 50px;
		text-align: center;
	}
	.xuanC{
		margin-top: 20px;
		text-align: center;
	}

	.xuabIpute{
		width: 40%;
		height: 30px;
		text-align: center;
	}
	.divBtn{
		/*width: calc(100% - 20px);*/
		width: 100%;
		height: 45px;
		margin-top:30px;
		display: flex;
		/*padding: 0 10%;*/
	}
	.btns{
		width: 20%;
		height: 35px;
		text-align: center;
		line-height: 35px;
		border-radius: 3px;
		margin:0 15%;
	}
	.btnNo{
		/*border:1px solid #ccc;*/
	}
	.btnYeso{
		/*background: #1963AA;*/
		color:#1963AA;
	}



</style>

</head>
<body>
	{include file="public/wx_share" /}
    <div class="peoper">
    	<div class="top">
    		<div class="topL">七天内被查看的行为统计</div>
    		<div class="topR"><img src="__ROOT__ /AI_radar/image/time/rl.png" alt=""></div>
    	</div>
    	<div class="center">
	<!--     	<div class="one">
	    		<span class="seecolor seename">张三</span>查看了你的<span class="seekan">商品</span><span class="seexiang seecolor">C1培训班</span>共计<span class="seenum">10</span>次，<span class="seepan">有望成交</span>
	    	</div>
	    	<div class="one">
	    		<span class="seecolor seename">张三</span>查看了你的<span class="seekan">商品</span><span class="seexiang seecolor">C1培训班</span>共计<span class="seenum">10</span>次，<span class="seepan">有望成交</span>
	    	</div><div class="one">
	    		<span class="seecolor seename">张三</span>查看了你的<span class="seekan">商品</span><span class="seexiang seecolor">C1培训班</span>共计<span class="seenum">10</span>次，<span class="seepan">有望成交</span>
	    	</div> -->
	    	
    		
    	</div>
    	<div class="centerZ">点击查看更多</div>
	</div>
	<div class="xuan">
    	<div class="xuanN">
    		<div class="xuanT">选择时间段</div>
    		<div class="xuanC">
    			<input type="text" class="xuabIpute qian" data-field="date" readonly> 至 <input type="text" class="xuabIpute hou" data-field="date" readonly>
    		</div>
    		<div class="divBtn">
	    		<div class="btnNo btns">取消</div>
	    		<div class="btnYeso btns">确定</div>
	    	</div>
    	</div>
    </div>
    <div id="dtBox"></div>
    <div class="CRM_log" style="display:block;position: fixed;top: 0;left: 0;background:rgba(0,0,0,0);width:100%;height: 100%;">
        <div style="width:100%;height:100%;display:flex;vertical-align: middle;">
          <div style="width:3rem;height:3rem;margin: auto;">
            <img src="http://resource.17jxyx.com/goods/15537572830000.gif" alt="" class="load1Img" style="width:100%;height:auto;border-radius: 0.4rem;background: rgba(255,255,255,0.3)" />
           <!--  <div class="loadFont" style='width:100%;text-align: center;display: block;color:#fff;font-size: 20px;'>正在加载...</div> -->
          </div>
        </div>
    </div>
    <!-- <div id="footer"></div> -->

<script type="text/javascript">
	var types = "{$type}"
	var peoperYe = 1//分页
	// console.log(types)
	function peoper(type,starts,ends,page){
		// console.log(type,starts,ends,page)
		$(".CRM_log").css("display","block")
		$.ajax({
		    url:"https://business.17jxyx.com/enterprise/v1/behavior/category",
		    type:"POST",
		    contentType: "application/json",
    		dataType:"json",
		    data:JSON.stringify({
		    	token:window.tokens.token_boss,
		    	type:type,
		    	timeInfo:{start:starts,end:ends},
		    	page:page
		    	// timeInfo:{start:starts,end:ends}
		    }),
		    success:function(res){
			    console.log(res.data)
			    $(".CRM_log").css("display","none")
			    if(res.data != ''){
				    $.each(res.data, function(index, el) {
					    var seeOne = $("<div class='one'><span class='seecolor seename'>"+el.nickname+"</span><span class='seedong'>"+el.type+"</span>共计<span class='seenum'>"+el.times+"</span>次，<span class='seepan'>有望成交</span></div>")
					    $(seeOne).appendTo(".center")
					})
					$(".centerZ").click(function(){
						$(".CRM_log").css("display","block")

				    	page++
				    	// console.log(page)
				    	$.ajax({
						    url:"https://business.17jxyx.com/enterprise/v1/behavior/category",
						    type:"POST",
						    contentType: "application/json",
				    		dataType:"json",
						    data:JSON.stringify({
						    	token:window.tokens.token_boss,
						    	type:type,
						    	timeInfo:{start:starts,end:ends},
						    	page:page
						    	// timeInfo:{start:starts,end:ends}
						    }),
						    success:function(res){
							    // console.log(res.data)
							    $(".CRM_log").css("display","none")
							    if(res.data != ''){
								    $.each(res.data, function(index, el) {
									    var seeOne = $("<div class='one'><span class='seecolor seename'>"+el.nickname+"</span><span class='seedong'>"+el.type+"</span>共计<span class='seenum'>"+el.times+"</span>次，<span class='seepan'>有望成交</span></div>")
									    $(seeOne).appendTo(".center")
									})
								}else{
							    	$(".centerZ").html("没有更多了")
							    }
						    },
						    error:function(res){
						      console.log(res)
						    }
						});
				    	// peoper(type,starts,ends,page)
				    })
			    }else{
			    	$(".centerZ").html("没有更多了")
			    }


			  //   var scrollTopPan = true;
			 	// $(".centerTime").scroll(function(){
			  //   	var scrollHeights = document.querySelector(".centerTime").scrollHeight
			  //   	var heights = $(".centerTime").height()
			  //   	var scrollTops = $(".centerTime").scrollTop()
			 	//  		if(scrollTopPan){
			 	//  			scrollTopPan = false
				 // 	 		page++
				 // 	 		peoper(types,qiant,hout,page)
				 // 	 		document.querySelector(".centerTime").scrollTop = scrollHeights - heights - 160
				 // 	 		console.log(scrollHeights,"dfgfsdafasdfsfasdffs")
				 // 	 		console.log("加载")
				 // 	 		setTimeout(function(){
					//     		scrollTopPan = true
					//     	},3000)
			 	//  		}
			 	//  	}
		    },
		    error:function(res){
		      console.log(res)
			    $(".CRM_log").css("display","none")

		    }
		});
	}
	var timestamp = Date.parse(new Date())/1000;
	var das = timestamp - 24*60*60*7
	peoper(types,das,timestamp,peoperYe)
	// function seeClick(type,starts,ends,page){
		 // 
	    //取消
	 $(".btnNo").click(function(){
	 	$(".xuan").css("display","none")
	 })
	 //确定
	 $(".btnYeso").click(function(){
	 	var qian = $(".qian").val()
	 	var hou = $(".hou").val()
	 	// var qianY=qian.slice(0,2);
	 	// var qianM=qian.slice(3,5);
	 	// var qianD=qian.slice(6);
	 	// var qianVal = qianD + "-" + qianM + "-" + qianY;
	 	// var houY=hou.slice(0,2);
	 	// var houM=hou.slice(3,5);
	 	// var houD=hou.slice(6);
	 	// var houVal = houD + "-" + houM + "-" + houY;
		var qiandz = new Date(qian)
		var qiant = qiandz.getTime(qiandz) / 1000
		var houdz = new Date(hou)
		var hout = houdz.getTime(houdz) / 1000
		hout = hout + 86400
		console.log(qiant,hout)
		if(qiant<hout){
			$(".one").each(function(onea,oneb){
				oneb.remove()
			})
		 	peoper(types,qiant,hout,peoperYe)
				

		 	$(".xuan").css("display","none")
			
		}else{
			alert("请选择正确时间段（起始时间应小于结束时间）")
		}

	 })
	 //选择时间
	 $(".topR").click(function(){

	    $(".xuan").css("display","block")
	 })
	 //选择时间弹出框
	 $("#dtBox").DateTimePicker({

		init: function()
		{
			var oDTP = this;
			oDTP.setDateTimeStringInInputField();
		}

	});

	 


</script>
</body>
</html>